export function buildTree(files: any[]) {
  const tree: any = {};

  files.forEach(file => {
    const parts = file.path.split('/');
    let currentLevel = tree;

    parts.forEach((part, index) => {
      if (!currentLevel[part]) {
        currentLevel[part] = index === parts.length - 1 ? file : {};
      }
      currentLevel = currentLevel[part];
    });
  });

  return tree;
} 